<?php
require_once 'facebook.php';

$appapikey = '';
$appsecret = '';
$facebook = new Facebook($appapikey, $appsecret);
$user = $facebook->get_loggedin_user();
$is_logged_out = !$user;
$is_app_added = $facebook->api_client->users_isAppAdded();